
<?php

class App_Models_Article
{
    public function get_articles()
    {
        $db = Core_Db::instance();

        $result = $db->query("SELECT * FROM `article` ORDER BY `id` DESC;");
        
        if ($result) {
            return $result;
        } else {
            return false;
        }
    }

    public function get_article($id)
    {
        $db = Core_Db::instance();

        $result = $db->query("SELECT * FROM `article` WHERE `id` = " .  mysql_real_escape_string($id) . ";");

        if ($result) {
            return $result;
        } else {
            return false;
        }
    }
}
   
?>
